package com.lyf.aop.practice.practice_5_16.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.support.JdbcAccessor;

import javax.sql.DataSource;

/**
 * @AUTHOR LYF
 * @DATE 2022/5/16
 * @VERSION 1.0
 * @DESC
 */
@Configuration
@ComponentScan(value = {"com.lyf.aop.practice"})
public class GlobalConfig {
    @Autowired
    DataSource dataSource;

    // 配置
    @Bean
    JdbcTemplate jdbcTemplate(){
        JdbcTemplate jdbcTemplate = new JdbcTemplate();
        jdbcTemplate.setDataSource(dataSource);
        return jdbcTemplate;
    }





}
